const fs = require('fs');

try {
    fs.appendFileSync('./1.txt', '欲穷千里目', 'utf8');
    console.log('写入OK:');
} catch (err) {
    console.log('写入失败:' + err.message);
}